#ifndef QWGRAPHICSVIEW_H
#define QWGRAPHICSVIEW_H

#include <QObject>
#include <QGraphicsView>


class QWGraphicsView : public QGraphicsView
{
    Q_OBJECT

public:
    QWGraphicsView(QWidget *parent=0);

    virtual ~QWGraphicsView()
    {
    }

    void setBActive(bool bActive);

protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void wheelEvent(QWheelEvent  *event);

signals:
    void mouseMovePoint(QPoint point); //鼠标移动    
    void mouseClicked(QPointF point); //鼠标单击
    void mouseReleasePoint(QPoint point); //鼠标单击
    void mouseDoubleClick(QPoint point); //双击事件
    void keyPress(QKeyEvent *event); //按键事件

private:
    bool m_bActive;
};

#endif // QWGRAPHICSVIEW_H
